//
//  SAProductChooseColorHeaderView2.m
//  yidiantong
//
//  Created by 黄志刚 on 2020/10/14.
//

#import "SAProductChooseColorHeaderView2.h"

@interface SAProductChooseColorHeaderView2()

@property (weak, nonatomic)  UILabel *hitLabel;
@property (nonatomic,strong) UIButton * deleteBtn;

@end

@implementation SAProductChooseColorHeaderView2

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self creatUI];
        
    }
    return self;
}

-(void)refreshWithTitle:(NSString *)title Placeholder:(NSString *)placeholder AndTip:(NSString *)tip {
    self.hitLabel.text = title;
    [self.deleteBtn setTitle:tip forState:UIControlStateNormal];
}

-(void)creatUI {
    
    UIView *bgView = [[UIView alloc] initWithFrame:SARectMake(0, 0, kBaseScreenWidth, 32)];
    bgView.backgroundColor = kColor(241, 241, 241, 1);
    [self addSubview:bgView];
    
    UILabel *hitLabel = [[UILabel alloc] initWithFrame:SARectMake(22, 0, 60, 32)];
    hitLabel.textAlignment = NSTextAlignmentLeft;
    hitLabel.textColor = kGrayColor;
    hitLabel.font = [UIFont systemFontOfSize:kScaleNum(16)];
    [self addSubview:hitLabel];
    _hitLabel = hitLabel;
    
    UIButton *deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    deleteBtn.frame = CGRectMake(kScreenWidth - kScaleNum(300), kScaleNum(0), kScaleNum(275), kScaleNum(32));
    [deleteBtn setImage:[UIImage imageNamed:@"Shop_?"] forState:UIControlStateNormal];
    [deleteBtn setTitleColor:kLightgGrayColor forState:UIControlStateNormal];
    deleteBtn.contentHorizontalAlignment  = UIControlContentHorizontalAlignmentRight;
    deleteBtn.titleLabel.font = kFont(13);
    deleteBtn.userInteractionEnabled = NO;
    [self addSubview:deleteBtn];
    _deleteBtn = deleteBtn;
}


@end
